package com.cloud.cloudshop.shop.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cloud.cloudshop.shop.dao.GoodsCatesDao;
import com.cloud.cloudshop.shop.service.GoodsCatesService;
import com.cloud.cloudshop.util.PageUtils;
import com.cloud.cloudshop.util.Query;
import com.cloud.common.entity.GoodsCatesEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service("goodsCatesService")
public class GoodsCatesServiceImpl extends ServiceImpl<GoodsCatesDao, GoodsCatesEntity> implements GoodsCatesService {

    @Autowired
    private GoodsCatesDao goodsCatesDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<GoodsCatesEntity> page = this.page(
                new Query<GoodsCatesEntity>().getPage(params),
                new QueryWrapper<GoodsCatesEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<GoodsCatesEntity> listTree() {

        List<GoodsCatesEntity> goodsCatesEntities = goodsCatesDao.selectList(null);



        return goodsCatesEntities;
    }

}